//
//  DZDeailDownTableViewCell.m
//  DaZhePrivateHomeCuisineClient
//
//  Created by zouzhisheng on 14-12-15.
//  Copyright (c) 2014年 zouzhisheng. All rights reserved.
//

#import "DZDeailDownTableViewCell.h"
#import "Common.h"
#import "DZDinningDetailViewController.h"
@implementation DZDeailDownTableViewCell

- (void)awakeFromNib
{
    // Initialization code
    self.backView.layer.borderColor=[UIColor whiteColor].CGColor;
    self.backView.layer.cornerRadius=5;
    self.backView.layer.borderWidth=1.0;
    self.contentView.backgroundColor=[UIColor colorWithHexString:@"ECECEC"];
    self.detailWebView.layer.borderColor=[UIColor whiteColor].CGColor;
    self.detailWebView.layer.cornerRadius=5;
    self.detailWebView.layer.borderWidth=1.0;
    self.detailWebView.scrollView.bounces=NO;
    self.detailWebView.clipsToBounds=YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)loadData:(DZRestanutantDetailSubModel*)model{
    NSLog(@"model.content===%@",model.content);
    NSString *htmlstr=[Common changeToHtmlStr:model.content];
    self.detailWebView.delegate=self;
    [self.detailWebView loadHTMLString:htmlstr baseURL:nil];
    /**
     [row21 setObject:@"<ul>	<li>	<span style='line-height:1.5;'>包房：无</span> </li> <li>	<span style='line-height:1.5;'>车位：</span><span style='line-height:1.5;'>2</span><span style='line-height:1.5;'>个</span> </li> <li>	<span style='line-height:1.5;'>wifi：有</span> </li> <li>	<span style='line-height:1.5;'>外送：无</span> </li> <li>	简介： <p class='MsoNormal'>　　	很有情调的小咖啡店，装修温馨，是个可以享受时光的好地方。 </p> </li> </ul> <p class='MsoNormal'>	<span></span> </p>" forKey:@"text"];
     **/
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
    CGRect frame = webView.frame;
    CGSize fittingSize = [webView sizeThatFits:CGSizeZero];
    frame.size = fittingSize;
    webView.frame = frame;
    self.backView.height=frame.size.height;
    DZDinningDetailViewController *vc=(DZDinningDetailViewController*)[self viewController];
    [vc reloadTableViewHeight:frame.size.height];
    
}
- (UIViewController*)viewController {
    for (UIView* next = [self superview]; next; next =
         next.superview) {
        UIResponder* nextResponder = [next nextResponder];
        if ([nextResponder isKindOfClass:[UIViewController
                                          class]]) {
            return (UIViewController*)nextResponder;
        }
    }
    return nil;
}


@end
